package com.yuwei.http

import com.yuwei.base.entity.Res
import com.yuwei.http.entity.*
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query


interface ApiService {
    @POST(Const.LOGIN_URL)
    suspend fun login(@Query("username")username : String,@Query("password")password : String): Res<UserEntity>
    @POST(Const.REGISTER_URL)
    suspend fun register(@Query("username")username : String,@Query("password")password : String): Res<UserEntity>
    @GET(Const.GET_NOTICE_URL)
    suspend fun getNotice(@Query("page")page : Int,@Query("size")size : Int) : Res<NoticeEntity>
    @POST(Const.GET_ACCESS_ID_URL)
    suspend fun getAccessId(@Body param : AccessIdParam) : Res<AccessIdEntity>
    @GET(Const.GET_MESSAGE_URL)
    suspend fun getMessage(@Query("accessId")accessId : String,@Query("userId")userId : Int) : Res<MessageEntity>
    @GET(Const.GET_NOTICE_BY_USER_ID_URL)
    suspend fun getNoticeByUserId(@Query("userId")userId : Int) : Res<NoticeEntity>
    @GET(Const.GET_PARKING_LOT_LIST_URL)
    suspend fun getParkingLotList(@Path("areaId")areaId : Int) : Res<ParkingLotEntity>
    @GET(Const.GET_PARKING_LOT_DETAIL_URL)
    suspend fun getParkingLotDetail(@Path("id")id : Int) : Res<ParkingLotEntityItem>
    @POST(Const.ADD_PARKING_LOT_URL)
    suspend fun addParkingLot(@Body param : ParkingLotEntityItem) : Res<ParkingLotEntityItem>
    @PUT(Const.UPDATE_PARKING_LOT_URL)
    suspend fun updateParkingLot(@Path("id")id : Int,@Body param : ParkingLotEntityItem) : Res<ParkingLotEntityItem>
    @GET(Const.GET_PATROL_TASKS_URL)
    suspend fun getPatrolList() : Res<PatrolEntity>
    @GET(Const.GET_PATROL_POINTS_URL)
    suspend fun getPatrolPoints() : Res<PatrolPointsEntity>
    @GET(Const.GET_DEVICES_URL)
    suspend fun getDevices() : Res<DeviceEntity>
    @POST(Const.POST_EDIT_PATROL_URL)
    suspend fun postEditPatrol(@Body param : EditPatrolEntity) : Res<EditPatrolEntity>
    @GET(Const.GET_VISIT_LIST_URL)
    suspend fun getVisitList() : Res<VisitEntity>
    @GET(Const.GET_PROPERTY_LIST_URL)
    suspend fun getPropertyList(@Path("regionId")regionId : Int) : Res<PropertyEntity>
    @GET(Const.GET_TENANT_LIST_URL)
    suspend fun getTenantList() : Res<TenantEntity>
}